package com.zm.schedule.schedulemgr.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.zm.base.core.exception.BaseException;
import com.zm.base.core.serivice.IBaseService;
import com.zm.schedule.schedulemgr.po.TbZmScheduleJob;
import com.zm.schedule.schedulemgr.po.TbZmScheduleJobLog;
import com.zm.schedule.schedulemgr.vo.TbZmScheduleJobVO;

/**
 * @author chenhuaming
 * @Time：2017年5月3日 下午1:10:07
 * @version 1.0
 */
public interface IScheduleService extends IBaseService {
/**
 * 保存任务
 * saveSchedule:() 
 * @author chenhuaming 
 * @param po
 * @throws BaseException
 * @throws Exception
 */
public void saveSchedule(TbZmScheduleJob po)throws BaseException,Exception;
/**
 * 修改任务
 * updateSchedule:() 
 * @author chenhuaming 
 * @param po
 * @throws BaseException
 * @throws Exception
 */
public void updateSchedule(TbZmScheduleJob po)throws BaseException,Exception;
/**
 * 删除任务
 * deleteSchedule:() 
 * @author chenhuaming 
 * @param id
 * @throws BaseException
 * @throws Exception
 */
public void deleteSchedule(String[] ids)throws BaseException,Exception;
/**
 * 查询单个任务
 * getSchedule:() 
 * @author chenhuaming 
 * @param id
 * @return
 * @throws BaseException
 * @throws Exception
 */
public TbZmScheduleJob getSchedule(String id)throws BaseException,Exception;
/**
 * 分页查询任务
 * getCourseManagerClass:() 
 * @author chenhuaming 
 * @param page
 * @param orgId
 * @return
 * @throws BaseException
 * @throws Exception
 */
public PageInfo<TbZmScheduleJobVO> getTbZmScheduleJobByPage(Page page,String jobName,String jobGroup) throws BaseException,Exception;
/**
 * 查询所有任务
 * @author chenhuaming
 * @Time 2017年5月9日
 * @return
 * @throws BaseException
 * @throws Exception
 */
public List<TbZmScheduleJob> getAllTbZmScheduleJob()throws BaseException,Exception;
/**
 * 更新任务状态
 * updateJobStatusByJobName:() 
 * @author chenhuaming 
 * @param status
 * @param jobName
 * @throws BaseException
 * @throws Exception
 */
public void  updateJobStatusByJobName(String status,String jobName)throws BaseException,Exception;
/**
 * 保存日志
 * saveTbZmScheduleJobLog:() 
 * @author chenhuaming 
 * @param log
 * @throws BaseException
 * @throws Exception
 */
public void saveTbZmScheduleJobLog(TbZmScheduleJobLog log)throws BaseException,Exception;
/**
 * 停止任务
 * stopSchedule:() 
 * @author chenhuaming 
 * @param job
 * @throws BaseException
 * @throws Exception
 */
public void stopSchedule(TbZmScheduleJob job)throws BaseException,Exception;
/**
 * 启动任务
 * startSchedule:() 
 * @author chenhuaming 
 * @param job
 * @throws BaseException
 * @throws Exception
 */
public void startSchedule(TbZmScheduleJob job)throws BaseException,Exception;
/**
 * 删除5天前的任务调度
 * delJobLogFiveDayAgo:() 
 * @author chenhuaming 
 * @throws BaseException
 * @throws Exception
 */
public void delJobLogFiveDayAgo()throws BaseException,Exception;
/**
 * 根据job名称和组名 查询job
 * getJobByJobNameAndJobGroup:() 
 * @author chenhuaming 
 * @param jobName
 * @param jobGroup
 * @return
 * @throws BaseException
 * @throws Exception
 */
public TbZmScheduleJob getJobByJobNameAndJobGroup(@Param(value="jobName")String jobName,@Param(value="jobGroup")String jobGroup)throws BaseException,Exception;
}
